﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using FrmMain;

namespace FMain
{
    public partial class frmZhu : Form
    {
        public frmZhu()
        {
            InitializeComponent();
        }
        Dao dao = new Dao();
        private void button1_Click(object sender, EventArgs e)
        {
            if (!textBox1.Text.Equals(string.Empty) &&!textBox2.Text.Equals(string.Empty) && !textBox3.Text.Equals(string.Empty))
            {
                string sql = string.Format(@"insert into  [User]  values ('{0}','{1}')", textBox2.Text, textBox1.Text);
                if (dao.DoNonquery(sql) > 0)
                {
                    MessageBox.Show("注册成功");
                }
                else {
                    MessageBox.Show("注册失败");
                }
            }
            else {
                MessageBox.Show("请输入完整信息");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
